﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>下载</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <link rel="stylesheet" media="only screen and (max-width:359px)" href="css/320.css" />
    <link rel="stylesheet" media="only screen and (min-width:360px)" href="css/384.css" />
    <script type="text/javascript" src="js/comm.js"></script>
    <script type="text/javascript" src="js/jquery-1.10.1.min.js"></script>
</head>
<body style=" background:#333; text-align:center">
    <img id="tip" src="images/wechat-down.jpg" style="display:none;width: 65%;margin-top:10% " /> 
    <script type="text/javascript">
        var androidUrl = "http://a.app.qq.com/o/simple.jsp?pkgname=cn.uwaytech.uwayparking";
        var iosUrl = "https://itunes.apple.com/cn/app/ting-che-you-wei/id1002406364?mt=8";

        /*
        * 智能机浏览器版本信息:
        *
        */
        var browser = {
            versions: function () {
                var u = navigator.userAgent, app = navigator.appVersion;
                return {//移动终端浏览器版本信息
                    trident: u.indexOf('Trident') > -1, //IE内核
                    presto: u.indexOf('Presto') > -1, //opera内核
                    webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
                    gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
                    mobile: !!u.match(/AppleWebKit.*Mobile.*/) || !!u.match(/AppleWebKit/), //是否为移动终端
                    ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
                    android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
                    iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器
                    iPad: u.indexOf('iPad') > -1, //是否iPad
                    webApp: u.indexOf('Safari') == -1 //是否web应该程序，没有头部与底部
                };
            } (),
            language: (navigator.browserLanguage || navigator.language).toLowerCase()
        }

        var os;
        if (browser.versions.ios || browser.versions.iPhone || browser.versions.iPad) {
            os = "ios";
        }
        else if (browser.versions.android) {
            os = "android";
        }

        var json_data = {
            "platform": os, //app平台类型 ios android
            "from": getParams("from") //下载途径
        }

 /*       function mm_count() {
            //console.log("count!")
        	$.ajax({
        		type: "POST",
                url: sitePath + "/v1/downloadCount",
                data: json_data,
                dataType: "jsonp",
                jsonpCallback: "jsonp",
                success: function (res) {
                    //alert (parseInt(res.code))
                },
                error: function () {
                    //alert("可能由于网络原因，提交失败......")
                }
            })
        }*/

        switch (os) {
            case "ios":
                {
                    if (navigator.userAgent.indexOf("MicroMess") > 0)
                        $('#tip').fadeToggle();
                    else {
                  //      mm_count();
                        window.location.href = iosUrl;
                    }
                }
                break;
            case "android":
                {                  
                  //  mm_count();
                    window.location.href = androidUrl;                    
                    break;
                }
        }
	</script>
</body>
</html>
